<template>
<div id="">
<home-head ></home-head>
<home-swiper :swiperList='swiperList'></home-swiper>
<home-icons :list='iconList'></home-icons>
<home-recommend :list='recommendList'></home-recommend>
<home-weekend :list='weekendList'></home-weekend>
</div>
</template>

<script>
import 	HomeHead from './component/head.vue'
import 	HomeSwiper from './component/swiper.vue'
import 	HomeIcons from './component/icons.vue'
import 	HomeRecommend from './component/recommend.vue'
import 	HomeWeekend from './component/Weekend.vue'
import  axios from 'axios'
export default {
  name: 'home',
  components:{
  	HomeHead,
  	HomeSwiper,
  	HomeIcons,
  	HomeRecommend,
  	HomeWeekend
  },
  data () {
  	return {
  		city:'',
  		swiperList:[],
  		iconList:[],
  		recommendList:[],
  		weekendList:[]
  	}
  },
  mounted (){
  	this.getHomeInfo()
  },
  methods:{
  	getHomeInfo(){
  		axios.get('/api/index.json')
			.then(this.getHomeInfoSucc)
  	},
  	getHomeInfoSucc(res){
  		res =res.data
  		if(res.ret && res.data){
  			const data= res.data
  			this.swiperList=data.swiperList
  			this.iconList=data.iconList
  			this.recommendList=data.recommendList
  			this.weekendList=data.weekendList
  			
  		}
  	}
  }

}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="stylus" scoped>

</style>
